<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/static/member/themes/YouErJiaoYu/header.jsp" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport"
	content="width=device-width initial-scale=1.0  maximum-scale=1.0">
<link href="${ctxStatic}/jquery-mobile/css/jquery.mobile-1.3.1.min.css" type="text/css" rel="stylesheet" />
<title>人工选择</title>
<script type="text/javascript">

$(document).ready(function() {
	$("#errorMessage").hide()
});

function getStudents(){
	var grade_id= $("#grade_id").val();
	$.get("${ctx}/edu/getStudentByGradeId?uid=${uid}&topage=${topage}&wechatId=${wechatId}&style=${style}", { grade_id: grade_id},function(data){
			var html="";
			if(data.length==0){
				html="暂无数据";
			}else{
				for(var i=0;i<data.length;i++){
					html+="<option  value="+data[i].id+" >"+data[i].name+"</option>";
				}
				
			}
			$("#student_id").html(html);
		});
}

</script>
</head>
<body>
	<div class="main">
		<div>
			<div>
				<div class="ztContent">
				<div data-role="header" align="center" style="margin:10px;">
						 
				</div>
					<c:if test="${not empty message  }">
						<span class="alert" >${message}</span>
					</c:if>
					<form id="inputForm" action="${ctx}/edu/bindingStudent" method="post" >
							<input type="hidden" name="action" value="reg" /> 
							<input type="hidden" name="uid" value="${uid }" /> 
							<input	type="hidden" name="topage" value="${topage }" />
							<input	type="hidden" name="wechatId" value="${wechatId }" />
							<input	type="hidden" name="login" value="1" />
							<input	type="hidden" name="style" value="${style}"/>
							<div align="center">
								
								<div class="control-group">
									<div class="controls">
											<select id="grade_id" name="grade_id"  onchange="getStudents();">
												<option  value="" >请选择</option>
												<c:forEach items="${gradeList }" var="grade">
												<option  value="${grade.id }" >${grade.name }</option>
												</c:forEach>
											</select>
									</div>
								</div>
								
								<div class="control-group">
									<div class="controls">
											<select id="student_id" name="student_id"  >
												<option  value="" >请选择</option>
											</select>
									</div>
								</div>
								<div   align="center">
									<input id="btnSubmit" class="btn btn-danger" type="submit"
										value="确定" />
								</div>
								<div  align="center">
									
								</div>
								
								
							</div>
						</form>
						
				</div>
			</div>
		</div>
	</div>
</body>


<jsp:include page="./footer.jsp"></jsp:include>
</html>